<form name="form1" id="form1" action="" method="post" enctype="multipart/form-data">
<input type="hidden" name="itemID" value="" />
<input type="hidden" name="mode" value="" />
<input type="hidden" name="type" value="" />
<table width="100%" border="0" cellpadding="5" cellspacing="2" class="list">
<tbody>
	<tr>
     <td width="5%" align="center" class="color-tr-td"><b><span onclick="checkAll()">Check</span> | <span onclick="uncheckAll()">Uncheck</span></b></td>
    <td width="20%" align="center" class="color-tr-td"><b>Tên</b></td>
    <?php if (Session::Get("CATE_SP") == 'true'):?>
    <td width="15%" align="center" class="color-tr-td">Giá/<br>sản phẩm</td>
    <td width="5%" align="center" class="color-tr-td">KM</td>
    <td width="15%" align="center" class="color-tr-td">Giá</td>
    <td width="5%" align="center" class="color-tr-td">Display</td>
    <?php endif;?>
    <td width="5%" align="center" class="color-tr-td">&nbsp;</td>
    <td width="5%" align="center" class="color-tr-td">&nbsp;</td>
     <td width="5%" align="center" class="color-tr-td"><b>DELETE</b></td>
   </tr>
	<?php if (count ($this->arrSCategory) > 0) {
   		$i=0;
   		foreach ($this->arrSCategory as $sCategory) {
   	?>
		<tr class="<?php if ($i%2==0) echo 'blue'; else echo 'white'; ?>">
			<td align="center"><input type="checkbox" name="checkdel[]" value="<?php echo $sCategory['id'];?>" /></td>
			<td onclick="frmSubmit('m=scategory&a=edit&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?><?php echo constants::$pathUrl;?>', '<?php echo $sCategory['id']; ?>', '', '')">
				<?php echo $sCategory['name'];?>
			</td>
			<td align="center"><?php if ($this->maxseq != $sCategory['seq']) :?><label onclick="frmSubmit('m=scategory&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?><?php echo constants::$pathUrl;?>', '<?php echo $sCategory['id']; ?>', 'up', '<?php echo $sCategory['seq']; ?>')">▲</label><?php endif;?></td>
			<td align="center"><?php if ($this->minseq != $sCategory['seq']) :?><label onclick="frmSubmit('m=scategory&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?><?php echo constants::$pathUrl;?>', '<?php echo $sCategory['id']; ?>', 'down', '<?php echo $sCategory['seq']; ?>')">▼</label><?php endif;?></td>
			<td align="center" onclick="if(cfdelete()){frmSubmit('m=scategory&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?><?php echo constants::$pathUrl;?>', '<?php echo $sCategory['id']; ?>', 'delete', '<?php echo $this->iddm;?>');}"><img src="images/default/b_usrdrop.png" /></td>
		</tr>
   		<?php 
   		$i++;
   		}
   		?>
	   <?php if ($this->flagAdd) :?>
	   	<tr>
	     	<td width="5%" align="center" class="color-tr-td"><input  onclick="if(cfdelete()){frmSubmit('m=scategory&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?><?php echo constants::$pathUrl;?>', '', 'deleteall', '');}" type="button" name="deleteall" value="Delete All" /></td>
	    	<td colspan="5" align="left" class="color-tr-td"><a href="index.php?m=scategory&a=edit&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?><?php echo constants::$pathUrl;?>"><img src="images/default/b_add.png" border="0" width="27" /></a></td>
	    </tr>
	   <?php endif;?>
	<?php } elseif (count ($this->arrSanPham) > 0) {
   		$i=0;
   		foreach ($this->arrSanPham as $sanpham) {
   	?>
		<tr class="<?php if ($i%2==0) echo 'blue'; else echo 'white';?>">
		     <td align="center"><input type="checkbox" name="checkdel[]" value="<?php echo $sanpham['id'];?>" /></td>
		     <td onclick="frmSubmit('m=sanpham&a=edit&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?><?php echo constants::$pathUrl;?>', '<?php echo $sanpham['id']; ?>', '', '')">
	   			<?php echo $sanpham['name'];?>
		     </td>
		     <td align="center"><?php echo number_format($sanpham['gia1']);?>,000 VNĐ</td>
		     <td align="center" style="background:#CCC;"><?php if($sanpham['check_km']=='1'){echo "<img src='images/default/tick.png' border='0' width='16' title='back'/>";}?></td>
		     <td align="center" style="background:#CCC;"><?php if($sanpham['check_km']=='1'){echo number_format($sanpham['gia2']).',000 VNĐ';}?></td>
		     <td align="center">
		     	<input <?php if ($sanpham['check_dis'] == 1) {echo "checked='checked'";}?> type="checkbox" name="check_dis[]" value="<?php echo $sanpham['id'];?>" />
		     	<input type="hidden" name="data[]" value="<?php echo $sanpham['id'];?>" />
		     </td>
		     <td align="center"><?php if ($this->maxseq != $sanpham['seq']) :?><label onclick="frmSubmit('m=scategory&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?><?php echo constants::$pathUrl;?>', '<?php echo $sanpham['id']; ?>', 'up', '<?php echo $sanpham['seq']; ?>')">▲</label><?php endif;?></td>
		     <td align="center"><?php if ($this->minseq != $sanpham['seq']) :?><label onclick="frmSubmit('m=scategory&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?><?php echo constants::$pathUrl;?>', '<?php echo $sanpham['id']; ?>', 'down', '<?php echo $sanpham['seq']; ?>')">▼</label><?php endif;?></td>
		     <td align="center" onclick="if(cfdelete()){frmSubmit('m=scategory&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?><?php echo constants::$pathUrl;?>', '<?php echo $sanpham['id']; ?>', 'delete', '');}"><img src="images/default/b_usrdrop.png" /></td>
		  </tr>
   		<?php 
   		$i++;
   		}
   		?>
   <tr>
    <td width="5%" align="center" class="color-tr-td"><input onclick="if(cfdelete()){frmSubmit('m=sanpham&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?><?php echo constants::$pathUrl;?>', '', 'deleteall', '');}" type="button" name="deleteall" value="Delete All" /></td>
    <td align="left" class="color-tr-td"><a href="index.php?m=sanpham&a=edit&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?>&by=111<?php echo constants::$pathUrl;?>"><img src="images/default/b_add.png" border="0" width="27" /></a></td>
    <td class="color-tr-td">&nbsp;</td>
    <td class="color-tr-td">&nbsp;</td>
    <td class="color-tr-td">&nbsp;</td>
    <?php if (Session::Get("CATE_SP") == 'true'):?>
    <td class="color-tr-td"><input onclick="frmSubmit('m=sanpham&a=display&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?>&by=111&back=1<?php echo constants::$pathUrl;?>', '', 'yes', '')" type="button" name="SubDis" value="Display" style="background:none;"></td>
    <td class="color-tr-td">&nbsp;</td>
    <td class="color-tr-td">&nbsp;</td>
    <td class="color-tr-td">&nbsp;</td>
    <?php endif;?>
    </tr>
	<?php } else {?>
	<tr>
		<td class="color-tr-td">&nbsp;</td>
		<td <?php if (Session::Get("CATE_SP") == 'true') {echo "colspan='4'";} else {echo "";}?> align="left" class="color-tr-td"><a href="index.php?m=scategory&a=edit&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?><?php echo constants::$pathUrl;?>"><img src="images/default/b_add.png" border="0" width="27" /></a><br>Tạo một thể loại tiếp</td>
		<td <?php if (Session::Get("CATE_SP") == 'true') {echo "colspan='4'";} else {echo "colspan='3'";}?> align="left" class="color-tr-td">&nbsp;<?php if($this->danhmucid > 1) {?><a href="index.php?m=sanpham&a=edit&danhmucid=<?php echo $this->danhmucid;?>&iddm=<?php echo $this->iddm;?>&subiddm=<?php echo $this->subiddm;?>&by=111<?php echo constants::$pathUrl;?>"><img src="images/default/b_add.png" border="0" width="27" /></a><br>Tạo sản phẩm mới<?php }?></td>
	</tr>
	<?php } ?>
</tbody>
</table>
</form>